<%@ taglib prefix="uthink" uri="/WEB-INF/tld/shiros.tld"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet"
	type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet"
	type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>新增用户</title>
<style type="text/css">
textarea {
	resize: none;
	width: 400px;
	height: 100px;
}
</style>
</head>
<body>
	<div class="pd-20">
		<form id="dataform" class="form form-horizontal">
			<input type="hidden" name="id" id="partnerid"
				value='${partnerdetail.id}' /> <input type="hidden" id="status"
				value='${partnerdetail.status}' />
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">基本信息</label>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">真实姓名：</label>
				<div class="formControls col-xs-8 col-sm-5">${partnerdetail.user_name}</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">性别</label>
				<div class="formControls col-3">
					<c:choose>
						<c:when test="${partnerdetail.gender == 0}">
						女
					</c:when>
						<c:when test="${partnerdetail.gender == 1}">
						男
					</c:when>
					</c:choose>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">证件类型</label>
				<div class="formControls col-3">
					<c:choose>
						<c:when test="${partnerdetail.cred_type == 1}">
						身份证
					</c:when>
						<c:when test="${partnerdetail.cred_type == 2}">
						军官证
					</c:when>
					</c:choose>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">证件编号：</label>
				<div class="formControls col-3">${partnerdetail.cred_no}</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">证件正面图片：</label>
				<div class="formControls col-xs-8 col-sm-5">
					<img width="100" height="100" src="${partnerdetail.photo_front}" />
				</div>
			</div>

			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">证件背面图片：</label>
				<div class="formControls col-xs-8 col-sm-5">
					<img width="100" height="100" src="${partnerdetail.photo_back}" />
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">推荐人：</label>
				<div class="formControls col-xs-8 col-sm-5">${partnerdetail.referee_name}</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">推荐人ID：</label>
				<div class="formControls col-xs-8 col-sm-5">${partnerdetail.referee_id}</div>
			</div>

			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">审核状态：</label>
				<div class="formControls col-xs-8 col-sm-5">
					<c:choose>
						<c:when test="${partnerdetail.status == 0}">
						待审核
					</c:when>
						<c:when test="${partnerdetail.status == 1}">
						已通过
					</c:when>
						<c:when test="${partnerdetail.status == 2}">
						未通过
					</c:when>
						<c:when test="${partnerdetail.status == 3}">
						已过期
					</c:when>
					</c:choose>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">申请时间：</label>
				<div class="formControls col-xs-8 col-sm-5">${partnerdetail.apply_time}</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">申请人地址：</label>
				<div class="formControls col-xs-8 col-sm-5">${partnerdetail.address}</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">开户机构id：</label>
				<div class="formControls col-xs-8 col-sm-5">${partnerdetail.corp_id}</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">开户机构名称：</label>
				<div class="formControls col-xs-8 col-sm-5">${partnerdetail.corp_name}</div>
			</div>

			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">审核信息</label>
			</div>

			<c:choose>
				<c:when test="${partnerdetail.status == 0}">
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">审核操作：</label>
						<div class="formControls col-xs-8 col-sm-5">
							<select name="status">
								<option value="1">通过</option>
								<option value="2">驳回</option>
							</select>
						</div>
					</div>

					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">审核意见：</label>
						<div class="formControls col-xs-8 col-sm-5">
							<textarea class="textarea" placeholder="" name="reason"
								onkeyup="$.Huitextarealength(this,500)"></textarea>
						</div>
					</div>

					<div class="row cl">
						<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
							<a class="btn btn-warning" onclick="save()"
								href="javascript:void(0);" title="提交">提交</a>
						</div>
					</div>
				</c:when>
				<c:otherwise>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">审核意见：</label>
						<div class="formControls col-xs-8 col-sm-5">
							<textarea class="textarea" placeholder="" readonly="readonly"
								name="reason">${partnerdetail.reason}</textarea>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">审核时间：</label>
						<div class="formControls col-xs-8 col-sm-5">${partnerdetail.update_time}
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-3">审核人：</label>
						<div class="formControls col-xs-8 col-sm-5">${partnerdetail.apply_uname}
						</div>
					</div>
					<c:if test="${partnerdetail.status == 1}">
						<div class="row cl">
							<label class="form-label col-xs-4 col-sm-3">合伙人二维码：</label>
							<div class="formControls col-xs-8 col-sm-5">
								<img width="100" height="100" id="qrcodeimg"
									src="<%=imagePath %>${partnerdetail.qrcode_img}" />
								<button type="button"
									onclick="recreateqrcode(${partnerdetail.id})">重新生成</button>
							</div>
						</div>
					</c:if>
				</c:otherwise>
			</c:choose>
		</form>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/2.1/layer.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script>
	<script type="text/javascript"
		src="lib/Validform/5.3.2/Validform.min.js"></script>
	<script type="text/javascript"
		src="lib/webuploader/0.1.5/webuploader.min.js"></script>
	<script type="text/javascript"
		src="lib/ueditor/1.4.3/ueditor.config.js"></script>
	<script type="text/javascript"
		src="lib/ueditor/1.4.3/ueditor.all.min.js"></script>
	<script type="text/javascript"
		src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript">
		function save() {
				$.ajax({
					type :"post",
					url : "<%=basePath%>backstage/validate_member_partner",
					data : $("#dataform").serialize(),
					success : function(msg) {
						var info=eval( '(' + msg + ')');
						if (info.error== "0000") {
							window.parent.location.reload();
							var index=parent.layer.getFrameIndex(window.name);
					        parent.layer.close(index);
						} else {
							parent.layer.alert(info.information, {
								icon : 2,
								skin : '系统提示'
							})
						}
					}
				})
		}
		
		function recreateqrcode(id){
			$.ajax({
				type:"post",
				url: "<%=basePath%>backstage/recreatePartnerQRcode",
				data : "partnerid="+id,
				success : function(msg) {
					var info = eval('(' + msg + ')');
					if (info.code == "0000") {
						parent.layer.alert("重新生成成功！", {
							icon : 1,
							skin : '系统提示'
						})
						$("#qrcodeimg").attr("src","<%=imagePath%>"+info.information); 
					} else {
						parent.layer.alert("操作失败", {
							icon : 2,
							skin : '系统提示'
						})
					}
				}
			})
		}
</script>
</body>
</html>

